package com.block.datapush.service.apipush.utils;

import cn.hutool.core.util.StrUtil;
import com.block.common.enums.BaseTypeInfoEnum;

/**
 * 借你花 APIB回调
 */
public class JieNiHuaApiBUtil {

    //性别
    public static Integer getGender(Integer gender) {
       if (gender == 1){
           return 2;
       }
        return 1;
    }

    //贷款金额
    public static Integer getLoanAmount(String loanAmount) {
        if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la001.getValue())) {
            return 30000;
        } else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la002.getValue())) {
            return 50000;
        } else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la003.getValue())) {
            return 100000;
        }else if (StrUtil.equals(loanAmount, BaseTypeInfoEnum.LoanAmount.la004.getValue())) {
            return 200000;
        }
        return 250000;
    }

    //芝麻
    public static Integer getZhima(String zhima) {
        if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm001.getValue())){
            return 1;
        }else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm002.getValue())) {
            return 3;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm003.getValue())) {
            return 4;
        } else if (StrUtil.equals(zhima, BaseTypeInfoEnum.Zhima.zm004.getValue())) {
            return 5;
        }
        return 6;
    }

    //房产
    public static Integer getHouse(String house) {
        if (StrUtil.equals(house, BaseTypeInfoEnum.House.hu001.getValue())) {
            return 1;
        }
        return 2;
    }

    //车产
    public static Integer getCar(String car) {
        if (StrUtil.equals(car, BaseTypeInfoEnum.Car.car001.getValue())) {
            return 1;
        }
        return 2;
    }

    //公积金
    public static Integer getFund(String fund) {
        if (StrUtil.equals(fund, BaseTypeInfoEnum.Gjj.gjj001.getValue())) {
            return 1;
        } else if (StrUtil.equals(fund, BaseTypeInfoEnum.Gjj.gjj002.getValue())) {
            return 2;
        }
        return 3;
    }

    //社保
    public static Integer getShebao(String shebao) {
        if (StrUtil.equals(shebao, BaseTypeInfoEnum.Shebao.sb001.getValue())) {
            return 1;
        } else if (StrUtil.equals(shebao, BaseTypeInfoEnum.Shebao.sb002.getValue())) {
            return 2;
        }
        return 3;
    }

    //保险
    public static Integer getBaoxian(String baoxian) {
        if (StrUtil.equals(baoxian, BaseTypeInfoEnum.Baoxian.bx001.getValue())) {
            return 1;
        }
        return 2;
    }

    //信用卡
    public static Integer getXinYongKa(String xinyongka) {
        if (StrUtil.equals(xinyongka, BaseTypeInfoEnum.XinYongKa.xyk001.getValue())) {
            return 1;
        }
        return 4;
    }

    //花呗
    public static Integer getHuaBei(String huabei) {
        if (StrUtil.equals(huabei, BaseTypeInfoEnum.Huabei.hb001.getValue())) {
            return 1;
        }
        return 2;
    }

    //白条
    public static Integer getBaiTiao(String baitiao) {
        if (StrUtil.equals(baitiao, BaseTypeInfoEnum.Baitiao.bt001.getValue())) {
            return 1;
        }
        return 2;
    }

    //逾期
    public static Integer getYuqi(String yuqi) {
        if (StrUtil.equals(yuqi, BaseTypeInfoEnum.Yuqi.yq001.getValue())) {
            return 1;
        }else if (StrUtil.equals(yuqi, BaseTypeInfoEnum.Yuqi.yq002.getValue())) {
            return 4;
        }
        return 5;
    }

    //学历
    public static Integer getXueLi(String education) {
        if (StrUtil.equals(education, BaseTypeInfoEnum.XueLi.xl004.getValue()) || StrUtil.equals(education, BaseTypeInfoEnum.XueLi.xl005.getValue())) {
            return 1;
        }else if (StrUtil.equals(education, BaseTypeInfoEnum.XueLi.xl003.getValue())) {
            return 2;
        }else if (StrUtil.equals(education, BaseTypeInfoEnum.XueLi.xl002.getValue())) {
            return 3;
        }
        return 5;
    }

    //职业身份
    public static Integer getJob(String jbo) {
        if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz001.getValue())) {
            return 1;
        } else if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz002.getValue())) {
            return 3;
        } else if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz003.getValue())) {
            return 5;
        }else if (StrUtil.equals(jbo, BaseTypeInfoEnum.Gongzuo.gz004.getValue())) {
            return 2;
        }
        return 4;
    }

    //职业身份
    public static Integer getShouRu(String shouru) {
        if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr001.getValue())) {
            return 5000;
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr002.getValue())) {
            return 10000;
        } else if (StrUtil.equals(shouru, BaseTypeInfoEnum.Shouru.sr003.getValue())) {
            return 20000;
        }
        return 30000;
    }

    //贷款时间
    public static Integer getLoanTerm(String loanTime) {
        if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt001.getValue()) || StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt002.getValue())) {
            return 6;
        } else if (StrUtil.equals(loanTime, BaseTypeInfoEnum.LoanTime.lt003.getValue())) {
            return 12;
        }
        return 36;
    }



}
